import request from '@/utils/request'

// 分页查询
export function page(data) {
  return request({
    url: '/students/list',
    method: 'post',
    data
  })
}

// 新增
export function add(data) {
  return request({
    url: '/students',
    method: 'post',
    data
  })
}

// 修改
export function update(data) {
  return request({
    url: '/students',
    method: 'put',
    data
  })
}

// 根据ID查询
export function getById(id) {
  return request({
    url: `/students/${id}`,
    method: 'get'
  })
}

// 批量删除
export function deleteByIds(ids) {
  return request({
    url: `/students/${ids}`,
    method: 'delete'
  })
}

// 获取班级列表
export function getClasses() {
  return request({
    url: '/classes',
    method: 'get'
  })
}

// 获取学生统计数据
export function getStudentStats() {
  return request({
    url: '/students/stats',
    method: 'get'
  })
}
